package com.globant.tab;

import com.globant.tab.R;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainTabActivity extends TabActivity {
	
	private static final String BATTLE_TAB = "battleTab";
	private static final String JOB_TAB = "jobTab";
	private static final String PLACE_TAB = "placeTab";

	private void createTabs() {
		TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
		
		TabSpec placeTab = tabHost.newTabSpec(PLACE_TAB);
		placeTab.setIndicator(getResources().getText(R.string.place));
		placeTab.setContent(new Intent(this, PlaceTabActivity.class));
		tabHost.addTab(placeTab);
		
		TabSpec jobTab = tabHost.newTabSpec(JOB_TAB);
		jobTab.setIndicator(getResources().getText(R.string.jobs));
		jobTab.setContent(new Intent(this, JobTabActivity.class));
		tabHost.addTab(jobTab);
		
		TabSpec battleTab = tabHost.newTabSpec(BATTLE_TAB);
		battleTab.setIndicator(getResources().getText(R.string.battle));
		battleTab.setContent(new Intent(this, BattleTabActivity.class));
		tabHost.addTab(battleTab);
	}
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_tab);
        
        createTabs();
    }

}
